﻿using System;
using System.Collections.Generic;

namespace Bridge.Base.Constructs
{
    /// <summary>
    /// Class for sending properties to converters.
    /// </summary>
    public class ConverterProperty
    {
        /// <summary>
        /// Gets or sets the value of the property.
        /// </summary>
        public object Value
        {
            get { return mValue; }
            set { mValue = value; }
        }

        /// <summary>
        /// Gets or sets the key name of the property.
        /// </summary>
        public string Key
        {
            get { return mKey; }
            set { mKey = value; }
        }

        /// <summary>
        /// Gets or sets the function to call to validate the property.
        /// </summary>
        public Func<object, bool> Validator
        {
            get { return mValidator; }
            set { mValidator = value; }
        }

        /// <summary>
        /// Gets or sets the property choices that this property can be.
        /// </summary>
        public List<string> PropertyChoices
        {
            get { return mPropertyChoices; }
            set { mPropertyChoices = value; }
        }

        /// <summary>
        /// Gets or sets the <see cref="PropertyType"/> of the value.
        /// </summary>
        public PropertyType PropertyType
        {
            get { return mType; }
            set { mType = value; }
        }

        /// <summary>
        /// Gets or sets the filter extensions for if the <see cref="PropertyType"/> is File.
        /// </summary>
        public string FilterExtensions
        {
            get { return mFilterExtensions; }
            set { mFilterExtensions = value; }
        }

        private PropertyType mType = PropertyType.String;
        private object mValue = null;
        private string mKey = string.Empty;
        private Func<object, bool> mValidator = null;
        private List<string> mPropertyChoices = new List<string>();
        private string mFilterExtensions = string.Empty;
        private string mDefaultExtension = string.Empty;

    }
}
